Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/infer options arg #25

Merged
merged 10 commits into from
Jun 19, 2024
Merged

Feature/infer options arg #25

merged 10 commits into from
Jun 19, 2024

Conversation

parkervg
Copy link
Owner

This PR extends the infer_gen_constraints function to the options arg of a QAIngredient.

This minimizes verbosity in the common pattern where we have a {column} = {QAIngredient} predicate, and enforces a choice amongst the column values (unless otherwise specified).

Now, when we run blend with infer_gen_constraints=True, the below queries are equivalent.

SELECT * FROM w
    WHERE name = {{
        LLMQA(
            'Choose a name'
        )
    }}
SELECT * FROM w
    WHERE name = {{
        LLMQA(
            'Choose a name',
            options='w::name'
        )
    }}

Benchmark Runtimes

The benchmarks saw no noticeable change in performance with this PR. A little uptick in the 'rugby' task, will keep an eye on that in the future.

Before:

Task Average Runtime # Unique Queries
financials 0.0414736 7
rugby 0.255618 4
1966_nba_draft 0.124267 2

After:

Task Average Runtime # Unique Queries
financials 0.0461312 7
rugby 0.317933 4
1966_nba_draft 0.110849 2

@parkervg parkervg merged commit 7fefb40 into main Jun 19, 2024
14 checks passed
@parkervg parkervg deleted the feature/infer-options-arg branch June 19, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant